﻿#ifndef SPECTRUMPLAYBACK_H
#define SPECTRUMPLAYBACK_H

#include <QObject>
#include "SignalSpectrum.h"
class Spectrum;

class SpectrumPlayback : public QObject
{
    Q_OBJECT
public:
    explicit SpectrumPlayback(QObject *parent = nullptr);
    ~SpectrumPlayback();
    void stop();
    bool getIsRun() const;

    void setFileUrl(const QString &value);

    void setFftLen(int value);
    void setWinType(int value);
    void setDataType(int value);

    void setSmooth(bool value);
    void setSmoothNum(int value);

    void setInterval(int value);

signals:
    void signal_stop();
    void signal_playbackIsRun(bool isRun);
    void signal_playbackMessage(QString message);
    void signal_playbackSpectrumData(QString data);
public slots:
     void playback();
private:
     bool isRun;
     QString fileUrl;
     Spectrum *spectrum;

     int fftLen;
     int winType;
     int dataType;
     bool smooth;
     int smoothNum;
     int interval;
};

#endif // SPECTRUMPLAYBACK_H
